<?php

namespace app\models;

use think\Db;
use think\Model;

class Carorder extends Model
{
    protected $pk = 'id';
    protected $autoWriteTimestamp = 'datetime';
    protected $createTime = 'created';
    protected $defaultSoftDelete = 0;

    public function getStatusTextAttr($value, $data)
    {
        $text = '';
        switch ($data['status']) {
            case '1':
                $text = '待付款';
                break;
            case '2':
                $text = '待接单';
                break;
            case '3':
                $text = '进行中';
                break;
            case '4':
                $text = '已完成';
                break;
            case '5':
                $text = '已取消';
                break;
            default:
                # code...
                break;
        }
        return $text;
    }
}
